package com.example.python_manager.controller;

import com.example.python_manager.entity.Script;
import com.example.python_manager.mapper.ScriptMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description
 * @Author lihw
 * @Date 2023/12/27 11:29
 */
@Slf4j
@RestController
@RequestMapping("script")
public class ScriptController {

    @Autowired
    ScriptMapper scriptMapper;

    @PostMapping("save")
    public String save(@RequestBody Script script) {
        int insert = scriptMapper.insert(script);
        log.info("插入{}行, 插入对象: {}", insert, script);
        return "succ";
    }
}
